<?php

Route::get('/', 'IndexController@index')->name('admin');

#话题分类
Route::get('category', 'CategoryController@category')->name('admin.category');
Route::post('save_category', 'CategoryController@saveCategory')->name('admin.create_category');
Route::post('save_category/{topics?}', 'CategoryController@editCategory')->name('admin.edit_category');
Route::get('get_categories', 'CategoryController@getCategories')->name('admin.get_categories');
Route::get('get_category/{topics}', 'CategoryController@getCategory')->name('admin.get_category');
Route::post('delete_category', 'CategoryController@deleteCategory')->name('admin.delete_category');

#话题
Route::get('topics', 'TopicsController@index')->name('admin.topics');
Route::get('replies', 'TopicsController@replies')->name('admin.replies');

#站点设置
Route::get('site','SiteController@index')->name('admin.site');
Route::post('site/save','SiteController@save')->name('admin.site.save');
#资源推荐
Route::get('resource','ResourceController@index')->name('admin.resource');
Route::post('resource/save','ResourceController@save')->name('admin.resource.save');
Route::get('resource/get','ResourceController@get')->name('admin.resource.get');
Route::get('resource/first/{id}','ResourceController@first')->name('admin.resource.first');
Route::post('resource/delete','ResourceController@delete')->name('admin.resource.delete');

#用户管理
Route::get('user','UserController@index')->name('admin.user');
Route::get('user/get_one/{id}','UserController@getOne')->name('admin.get_one');
Route::post('user/save','UserController@save')->name('admin.user.save');

#行政地区管理
Route::get('district/{parentid?}','DistrictController@index')->name('admin.district')->where('parentid','[0-9]+');
Route::get('district/form/{id?}','DistrictController@form')->name('admin.district.form')->where('id','[0-9]+');
Route::post('district/save','DistrictController@save')->name('admin.district.save');
Route::get('district/get','DistrictController@get')->name('admin.district.get');
Route::get('district/first/{id}','DistrictController@first')->name('admin.district.first');
Route::get('district/get_by_parent/{parentid}','DistrictController@getByParent')->name('admin.district.get_by_parent');
Route::post('district/delete','DistrictController@delete')->name('admin.district.delete');

#社区管理
Route::get('communities','CommunitiesController@index')->name('admin.communities');
Route::get('communities/form/{id?}','CommunitiesController@form')->name('admin.communities.form')->where('id','[0-9]+');
Route::post('communities/save','CommunitiesController@save')->name('admin.communities.save');
Route::get('communities/get','CommunitiesController@get')->name('admin.communities.get');
Route::get('communities/first/{id}','CommunitiesController@first')->name('admin.communities.first');
Route::post('communities/delete','CommunitiesController@delete')->name('admin.communities.delete');